"responsive navigation"
Bootstrap 3.0.0 Snippet by Pawan Singhania

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="col-sm-8">
<ul class="navi">
<li><a href="#" title="">home</a></li>
<li><a href="#" title="">home</a></li>
<li><a href="#" title="">home</a></li>
<li><a href="#" title="">home</a></li>
<li><a href="#" title="">home</a></li>
<li class="icon"><a href="#" onclick="a()"></a></li>
</ul>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body
{
margin:0;
padding:0 0 0 0;
}
.main
{
margin: auto;
padding:20px;
width: 90%;
}
.navi
{
margin: 0;
padding: 0;
background-color: #000;
}
.navi li
{
display: inline-block;
}
.navi li a
{
display: inline-block;
margin: 0;
padding:20px;
color: #fff;
font-family: "arial";
font-size: 16px;
text-transform: uppercase;
font-weight: bold;
-webkit-transition:1s;
}
.navi li a:hover{background-color: red;}
.navi li.icon{display: none;}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
<script>
function a() {
document.getElementsByClassName("navi")[0].classList.toggle("icon");
}
</script>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: